/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PanCombatVictoire.java
 *
 * Created on 15 janv. 2012, 13:56:04
 */
package InterfaceGraphique.commonPannel;

import InterfaceGraphique.MainApplication;
import cartes.Carte;
import common.Constantes;
import java.awt.Font;
import java.awt.Point;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;

/**
 *
 * @author Arthur
 */
public class PanCombatVictoire extends javax.swing.JPanel {

    JFrame parent; 
    
    /** Creates new form PanCombatVictoire */
    public PanCombatVictoire() {
        //this.setBackground(new java.awt.Color(110,48,34));
        initComponents();
    }
    
    public PanCombatVictoire(JFrame parent) {
        this();
        this.parent = parent; 
        
        this.pCartes = new PanListeCarte("Sous le cadavre encore fumant du monstre, vous trouvez...", 710, 230, Constantes.UNDEFINED, parent);
        this.add(pCartes, new org.netbeans.lib.awtextra.AbsoluteConstraints(new Point(20, 200)));
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        lNiveauxUp = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();

        setBackground(new java.awt.Color(110, 48, 34));
        setMaximumSize(new java.awt.Dimension(820, 600));
        setMinimumSize(new java.awt.Dimension(820, 600));
        setPreferredSize(new java.awt.Dimension(820, 600));
        setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel1.setForeground(new java.awt.Color(213, 151, 0));
        jLabel1.setText("Le monstre est terrassé !");
        jLabel1.setName("jLabel1"); // NOI18N
        add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 30, -1, -1));
        try {
            System.out.println(System.getProperties().get("user.dir"));
            Font font = Font.createFont(Font.TRUETYPE_FONT, getClass().getResourceAsStream("/polices/cartoon.ttf"));
            font = font.deriveFont(24.0f);
            this.jLabel1.setFont(font);
        } catch (Exception ex) {
            Logger.getLogger(PanActionInit.class.getName()).log(Level.SEVERE, null, ex);
        }

        jLabel3.setForeground(new java.awt.Color(213, 151, 0));
        jLabel3.setText("Vous gagnez");
        jLabel3.setName("jLabel3"); // NOI18N
        add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 100, -1, -1));
        try {
            System.out.println(System.getProperties().get("user.dir"));
            Font font = Font.createFont(Font.TRUETYPE_FONT, getClass().getResourceAsStream("/polices/cartoon.ttf"));
            font = font.deriveFont(24.0f);
            this.jLabel3.setFont(font);
        } catch (Exception ex) {
            Logger.getLogger(PanActionInit.class.getName()).log(Level.SEVERE, null, ex);
        }

        lNiveauxUp.setForeground(new java.awt.Color(213, 151, 0));
        lNiveauxUp.setText("jLabel4");
        lNiveauxUp.setName("lNiveauxUp"); // NOI18N
        add(lNiveauxUp, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 100, -1, -1));
        try {
            System.out.println(System.getProperties().get("user.dir"));
            Font font = Font.createFont(Font.TRUETYPE_FONT, getClass().getResourceAsStream("/polices/cartoon.ttf"));
            font = font.deriveFont(24.0f);
            this.lNiveauxUp.setFont(font);
        } catch (Exception ex) {
            Logger.getLogger(PanActionInit.class.getName()).log(Level.SEVERE, null, ex);
        }

        jLabel5.setForeground(new java.awt.Color(213, 151, 0));
        jLabel5.setText("niveau !");
        jLabel5.setName("jLabel5"); // NOI18N
        add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 100, -1, -1));
        try {
            System.out.println(System.getProperties().get("user.dir"));
            Font font = Font.createFont(Font.TRUETYPE_FONT, getClass().getResourceAsStream("/polices/cartoon.ttf"));
            font = font.deriveFont(24.0f);
            this.jLabel5.setFont(font);
        } catch (Exception ex) {
            Logger.getLogger(PanActionInit.class.getName()).log(Level.SEVERE, null, ex);
        }

        jButton1.setText("Terminer");
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(360, 520, -1, -1));
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        MainApplication.endCombat();
    }//GEN-LAST:event_jButton1ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel lNiveauxUp;
    // End of variables declaration//GEN-END:variables
    private PanListeCarte pCartes;
    
    public void load(ArrayList<Carte> cartesPiochees, int nbNiveaux) {
        // Affichage du nombre de niveau d'upgrade
        this.lNiveauxUp.setText(nbNiveaux +"");      
        
        // Affichage des cartes trouvées + ajout à la main du joueur
        this.pCartes.setCartes(cartesPiochees, false);
    }
}
